Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Escaping } Doesn't Seem to be working

1586543360
spacemandev
Compendium Curator
I'm trying to write an inline nested macro: This works: !token-mod --set aura1_radius|[[5*@{selected|repeating_weapons_$0_range}]] I'm trying to make the 0 an input like this: !token-mod --set aura1_radius|[[5*@{selected|repeating_weapons_$?{Weapon|0}_range}]] But I get: No attribute was found for @{selected|repeating_weapons_${Weapon}
1586544137
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I think this is an order of operations issue. Attribute lookups are handled before queries are resolved.
Hmm. You may need to replace that pipe character, "|", with  |.   On the other hand, you ought not to replace characters inside attribute calls, as explained by this section on the Macros wiki page about this issue . So I'm not entirely sure whether it's possible to substitute numbers inside repeating attributes. 
1586545012

Edited 1586545075
spacemandev
Compendium Curator
Replacing the pipe character as well still doesn't work :/  Is there no way to get this to work? I'm trying to allow players to write macros that allow players to select whichever weapon they want to use instead of having a macro per weapon 
1586545602

Edited 1586545618
GiGs
Pro
Sheet Author
API Scripter
You can never make an attribute from parts. keith is correct that this is an order of operations issue. You can do this !token-mod --set aura1_radius|[[5*?{which weapon| 0,@{selected|repeating_weapons_$0_range}| 1,@{selected|repeating_weapons_$1_range}| 2,@{selected|repeating_weapons_$2_range}}]]